package com.normal.utils

import android.content.Context
import android.text.TextUtils

object AppUtils {
    private var appName = ""
    fun getAppName(context: Context): String {
        if (!TextUtils.isEmpty(appName)) {
            return appName
        }
        val packageManager = context.packageManager
        val packageInfo = packageManager.getPackageInfo(context.packageName, 0)
        val labelRes = packageInfo.applicationInfo.labelRes
        appName = context.resources.getString(labelRes)
        return appName
    }
}